package com.aurora.blog.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aurora.blog.mapper.BlogCategoriesMapper;
import com.aurora.blog.domain.BlogCategories;
import com.aurora.blog.service.IBlogCategoriesService;

/**
 * 分类Service业务层处理
 * 
 * @author aurora
 * @date 2024-06-27
 */
@Service
public class BlogCategoriesServiceImpl implements IBlogCategoriesService 
{
    @Autowired
    private BlogCategoriesMapper blogCategoriesMapper;

    /**
     * 查询分类
     * 
     * @param categoryId 分类主键
     * @return 分类
     */
    @Override
    public BlogCategories selectBlogCategoriesByCategoryId(Long categoryId)
    {
        return blogCategoriesMapper.selectBlogCategoriesByCategoryId(categoryId);
    }

    /**
     * 查询分类列表
     * 
     * @param blogCategories 分类
     * @return 分类
     */
    @Override
    public List<BlogCategories> selectBlogCategoriesList(BlogCategories blogCategories)
    {
        return blogCategoriesMapper.selectBlogCategoriesList(blogCategories);
    }

    /**
     * 新增分类
     * 
     * @param blogCategories 分类
     * @return 结果
     */
    @Override
    public int insertBlogCategories(BlogCategories blogCategories)
    {
        return blogCategoriesMapper.insertBlogCategories(blogCategories);
    }

    /**
     * 修改分类
     * 
     * @param blogCategories 分类
     * @return 结果
     */
    @Override
    public int updateBlogCategories(BlogCategories blogCategories)
    {
        return blogCategoriesMapper.updateBlogCategories(blogCategories);
    }

    /**
     * 批量删除分类
     * 
     * @param categoryIds 需要删除的分类主键
     * @return 结果
     */
    @Override
    public int deleteBlogCategoriesByCategoryIds(Long[] categoryIds)
    {
        return blogCategoriesMapper.deleteBlogCategoriesByCategoryIds(categoryIds);
    }

    /**
     * 删除分类信息
     * 
     * @param categoryId 分类主键
     * @return 结果
     */
    @Override
    public int deleteBlogCategoriesByCategoryId(Long categoryId)
    {
        return blogCategoriesMapper.deleteBlogCategoriesByCategoryId(categoryId);
    }
}
